using ExampleWebApplication.Entities;
using NHibernate.Mapping.ByCode.Conformist;

namespace ExampleWebApplication.Infraestruture.NHibernate.EntityMappings
{
    public class CustomerCustomerDemoMap : ClassMapping<CustomerCustomerDemo>
    {
        public CustomerCustomerDemoMap()
        {
            Table("CustomerCustomerDemo");
            ComposedId(x => { x.Property(c => c.CustomerID, map => map.Column("CustomerID")); x.Property(c => c.CustomerTypeID, map => map.Column("CustomerTypeID")); });
            ManyToOne(x => x.Customer, map => map.Column("CustomerID"));
            ManyToOne(x => x.CustomerDemographic, map => map.Column("CustomerTypeID"));
        }
    }
}
